/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_expression_type.h

	$Header: /heroes4/script_expression_type.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_EXPRESSION_TYPE_H_INCLUDED )
#define SCRIPT_EXPRESSION_TYPE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <cassert>
#include <string>

enum t_script_context;

// --------------------------------------------------------------------------
// t_script_numeric_expression_type enum
// --------------------------------------------------------------------------

enum t_script_numeric_expression_type
{
	k_script_numeric_none = -1,
	k_script_numeric_creatures_in_army,
	k_script_numeric_day,
	k_script_numeric_day_of_week,
	k_script_numeric_divided_by,
	k_script_numeric_hero_experience_level,
	k_script_numeric_hero_skill_mastery,
	k_script_numeric_literal,
	k_script_numeric_material_quantity,
	k_script_numeric_minus,
	k_script_numeric_month,
	k_script_numeric_negate,
	k_script_numeric_player_number,
	k_script_numeric_plus,
	k_script_numeric_random,
	k_script_numeric_remainder,
	k_script_numeric_times,
	k_script_numeric_total_creatures_in_army,
	k_script_numeric_total_heroes_in_army,
	k_script_numeric_variable,
	k_script_numeric_week,
	k_script_numeric_week_of_month,

	k_script_numeric_expression_type_count,
};

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_keyword(
	t_script_numeric_expression_type	expression_type );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_script_numeric_expression_type get_script_numeric_expression_type(
	std::string const &	keyword );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool available(
	t_script_numeric_expression_type	expression_type,
	t_script_context					context );

// --------------------------------------------------------------------------
// k_script_boolean_expression_type enum
// --------------------------------------------------------------------------

enum t_script_boolean_expression_type
{
	k_script_boolean_none = -1,
	k_script_boolean_and,
	k_script_boolean_army_has_alignment,
	k_script_boolean_army_has_hero,
	k_script_boolean_can_give_skill,
	k_script_boolean_equals,
	k_script_boolean_false,
	k_script_boolean_greater_than,
	k_script_boolean_greater_than_or_equals,
	k_script_boolean_has_artifact,
	k_script_boolean_hero_is_dead,
	k_script_boolean_hero_is_imprisoned,
	k_script_boolean_less_than,
	k_script_boolean_less_than_or_equals,
	k_script_boolean_not,
	k_script_boolean_or,
//	k_script_boolean_player_has_visited,
	k_script_boolean_player_is_alignment,
	k_script_boolean_player_is_color,
	k_script_boolean_player_is_computer,
	k_script_boolean_player_is_eliminated,
	k_script_boolean_player_is_human,
	k_script_boolean_player_owns_hero,
	k_script_boolean_player_owns_town,
	k_script_boolean_true,
	k_script_boolean_variable,

	k_script_boolean_expression_type_count,
};

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_keyword(
	t_script_boolean_expression_type	expression_type );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_script_boolean_expression_type get_script_boolean_expression_type(
	std::string const &	keyword );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool available(
	t_script_boolean_expression_type	expression_type,
	t_script_context					context );

// --------------------------------------------------------------------------
// t_script_expression_type_type_traits class template
// --------------------------------------------------------------------------

template < typename t_expression_type >
struct t_script_expression_type_type_traits {};

template <>
struct t_script_expression_type_type_traits< t_script_numeric_expression_type >
{
	// Static data
	enum { k_count = k_script_numeric_expression_type_count };

	// Static member functions
	static t_script_numeric_expression_type get_type( std::string const & keyword )
	{
		return get_script_numeric_expression_type( keyword );
	}
};

template <>
struct t_script_expression_type_type_traits< t_script_boolean_expression_type >
{
	// Static data
	enum { k_count = k_script_boolean_expression_type_count };

	// Static member functions
	static t_script_boolean_expression_type get_type( std::string const & keyword )
	{
		return get_script_boolean_expression_type( keyword );
	}
};

#endif // !defined( SCRIPT_EXPRESSION_TYPE_H_INCLUDED )
